<!--版面头像-->
<script setup>

// props解包
import {onMounted, ref, toRefs} from "vue";
import {replaceResource} from "@/assets/js/routerUtils";

const props = defineProps({
  url: {type: String, required: true},
})
const {url} = toRefs(props);

const src = ref();
// 空头像
const empty = '/resources/ngabbs/nga_classic/f/00.png';

onMounted(() => {
  src.value = replaceResource(url.value);
})

</script>

<template>
  <el-avatar v-if="src" :src="src" style="--el-avatar-bg-color:none" @error="src=empty"/>
</template>

<style scoped>

</style>